import {
  Add_Counter,
  Add_To_Cart,
  Delete_Counter,
  Delete_Cart,
  Up_Data
} from "./Mutations-Types";

export default {
  [Add_Counter](state,payload){
    payload.count++
  },
  [Add_To_Cart](state,payload){
    state.cartList.push(payload)
  },
  [Delete_Counter](state,payload){
    if(payload.count > 1){
      payload.count--;
    }
  },
  [Delete_Cart](state,index){

    state.cartList.splice(index,1)
  },
  [Up_Data](state,pay){
    state.totalPrice = pay
  }
}
